package com.mit.web.util
{
	import com.mit.web.config.DisplayConfiguration;
	
	import flash.utils.getQualifiedClassName;
	
	import mx.logging.ILogger;
	import mx.logging.Log;
	import mx.logging.targets.TraceTarget;

	public class LogUtil
	{
		public function LogUtil()
		{
		}
		
		public static function initLogger():void{
			var logTarget:TraceTarget = new TraceTarget();
			logTarget.level = DisplayConfiguration.getInstance().LOG_LEVEL;
			logTarget.includeDate = true;			
			logTarget.includeTime = true;			
			logTarget.includeCategory = true;			
			logTarget.includeLevel = true;
			logTarget.filters = ["com.mit.web.*"];
			Log.addTarget(logTarget);

		}
		
		public static function getLogger(classObject:Object):ILogger{
			var className:String = flash.utils.getQualifiedClassName(classObject);
			var cat:String = className.replace("::",".");
			return Log.getLogger(cat);
		}
	}
}